﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TVServerComm;

namespace TVPlayer
{
    public partial class ChangingChannelWindow : Form
    {
        private string logoPath;
        private string channelName;
        private ProgramInfo currentProgram;
        private ProgramInfo nextProgram;
        private Form parentForm;

        public string LogoPath
        {
            set { logoPath = value;  }
        }

        public string ChannelName
        {
            set { channelName = value; }
        }

        public ProgramInfo CurrentProgram
        {
            set { currentProgram = value; }
        }

        public ProgramInfo NextProgram
        {
            set { nextProgram = value; }
        }

        public Form ActiveParentForm
        {
            set { parentForm = value; }
        }

        public ChangingChannelWindow()
        {
            InitializeComponent();
        }

        private void ChangingChannelWindow_Load(object sender, EventArgs e)
        {
         
            labelChannelname.Text = channelName;
            pictureBoxLogo.Image = Image.FromFile(logoPath);

            if (currentProgram != null)
            {
                labelCurrentProgram.Text = currentProgram.timeInfo + " " + currentProgram.title;
            }
            else
            {
                labelCurrentProgram.Text = "";
            }

            if (nextProgram != null)
            {
                labelNextProgram.Text = nextProgram.timeInfo + " " + nextProgram.title;
            }
            else
            {
                labelNextProgram.Text = "";
            }

            this.Location = new System.Drawing.Point(
                parentForm.Location.X +
                 (parentForm.Width - this.Width) / 2,
                parentForm.Location.Y +
                 (parentForm.Height - this.Height) / 2);
        }
    }
}
